package com.rabbitmq.demo.mqcluster;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;

public class Sender {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    @Scheduled(fixedDelay = 5000,initialDelay = 500)
    public void send(){
        rabbitTemplate.convertAndSend(null,"cluster.queue","Hello! RabbitMQ Cluster!");
    }
}
